﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.SharePoint.Explorer;

namespace SPVSX.Explorer.Extensions
{
    /// <summary>
    /// Represents an extension of SharePoint site nodes in Server Explorer for web part gallery. 
    /// </summary>
    // Enables Visual Studio to discover and load this extension.
    [Export(typeof(IExplorerNodeTypeExtension))]
    // Indicates that this class extends SharePoint site nodes in Server Explorer.
    [ExplorerNodeType("Microsoft.VisualStudio.SharePoint.Explorer.ListNode")]
    partial class ListNodeExtension : IExplorerNodeTypeExtension
    {
        public void Initialize(IExplorerNodeType nodeType)
        {
            InitializeListTemplateGallery(nodeType);
            InitializeMasterPageGallery(nodeType);
            InitializeSolutionGallery(nodeType);
            InitializeStyleLibrary(nodeType);
            InitializeThemeGallery(nodeType);
            InitializeWebPartGallery(nodeType);

            //Bind the events
            nodeType.NodeChildrenRequested += NodeChildrenRequested;
            nodeType.NodeMenuItemsRequested += NodeMenuItemsRequested;
            nodeType.NodePropertiesRequested += NodePropertiesRequested;
        }

        
        void NodeChildrenRequested(object sender, ExplorerNodeEventArgs e)
        {
            //throw new NotImplementedException();
        }

        void NodeMenuItemsRequested(object sender, ExplorerNodeMenuItemsRequestedEventArgs e)
        {
            //throw new NotImplementedException();
        }

        void NodePropertiesRequested(object sender, ExplorerNodePropertiesRequestedEventArgs e)
        {
            //throw new NotImplementedException();
        }

    }
}
